Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ cc_test(
deps = [
":include14",
"@com_google_absl//absl/base",
"@com_google_absl//absl/strings:strings",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
Expand All @@ -72,7 +72,7 @@ cc_test(
deps = [
":include14",
"@com_google_absl//absl/base",
"@com_google_absl//absl/strings:strings",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
Expand Down
14 changes: 14 additions & 0 deletions context_test.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "include/proxy-wasm/context.h"

#include "gtest/gtest.h"
Expand Down
10 changes: 6 additions & 4 deletions include/proxy-wasm/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ class ContextBase {

WasmBase *wasm() const { return wasm_; }
uint32_t id() const { return id_; }
bool isVmContext() { return id_ == 0; }
bool isRootContext() { return root_context_id_ == 0; }
bool isVmContext() const { return id_ == 0; }
bool isRootContext() const { return root_context_id_ == 0; }
ContextBase *root_context() { return root_context_; }
string_view root_id() const { return plugin_->root_id_; }
string_view log_prefix() const { return plugin_->log_prefix(); }
string_view root_id() const { return isRootContext() ? root_id_ : plugin_->root_id_; }
string_view log_prefix() const {
return isRootContext() ? root_log_prefix_ : plugin_->log_prefix();
}
WasmVm *wasmVm() const;

// Called before deleting the context.
Expand Down
17 changes: 16 additions & 1 deletion src/base64.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
// Public Domain: https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Original source Public Domain:
// https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64
#include "base64.h"

const static char encodeLookup[] =
Expand Down
18 changes: 17 additions & 1 deletion src/base64.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
// Public Domain: https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Original source Public Domain:
// https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64

#pragma once

#include <cstdint>
Expand Down
14 changes: 14 additions & 0 deletions wasm_vm_test.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "include/proxy-wasm/wasm_vm.h"

#include "gtest/gtest.h"
Expand Down