| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/renderer/script_context.h" | 5 #include "extensions/renderer/script_context.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 case Feature::CONTENT_SCRIPT_CONTEXT: | 51 case Feature::CONTENT_SCRIPT_CONTEXT: |
| 52 return "CONTENT_SCRIPT"; | 52 return "CONTENT_SCRIPT"; |
| 53 case Feature::WEB_PAGE_CONTEXT: | 53 case Feature::WEB_PAGE_CONTEXT: |
| 54 return "WEB_PAGE"; | 54 return "WEB_PAGE"; |
| 55 case Feature::BLESSED_WEB_PAGE_CONTEXT: | 55 case Feature::BLESSED_WEB_PAGE_CONTEXT: |
| 56 return "BLESSED_WEB_PAGE"; | 56 return "BLESSED_WEB_PAGE"; |
| 57 case Feature::WEBUI_CONTEXT: | 57 case Feature::WEBUI_CONTEXT: |
| 58 return "WEBUI"; | 58 return "WEBUI"; |
| 59 case Feature::SERVICE_WORKER_CONTEXT: | 59 case Feature::SERVICE_WORKER_CONTEXT: |
| 60 return "SERVICE_WORKER"; | 60 return "SERVICE_WORKER"; |
| 61 case Feature::LOCK_SCREEN_EXTENSION_CONTEXT: |
| 62 return "LOCK_SCREEN_EXTENSION"; |
| 61 } | 63 } |
| 62 NOTREACHED(); | 64 NOTREACHED(); |
| 63 return std::string(); | 65 return std::string(); |
| 64 } | 66 } |
| 65 | 67 |
| 66 static std::string ToStringOrDefault( | 68 static std::string ToStringOrDefault( |
| 67 const v8::Local<v8::String>& v8_string, | 69 const v8::Local<v8::String>& v8_string, |
| 68 const std::string& dflt) { | 70 const std::string& dflt) { |
| 69 if (v8_string.IsEmpty()) | 71 if (v8_string.IsEmpty()) |
| 70 return dflt; | 72 return dflt; |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 v8::Local<v8::Value> argv[]) { | 528 v8::Local<v8::Value> argv[]) { |
| 527 return context_->CallFunction(function, argc, argv); | 529 return context_->CallFunction(function, argc, argv); |
| 528 } | 530 } |
| 529 | 531 |
| 530 gin::ContextHolder* ScriptContext::Runner::GetContextHolder() { | 532 gin::ContextHolder* ScriptContext::Runner::GetContextHolder() { |
| 531 v8::HandleScope handle_scope(context_->isolate()); | 533 v8::HandleScope handle_scope(context_->isolate()); |
| 532 return gin::PerContextData::From(context_->v8_context())->context_holder(); | 534 return gin::PerContextData::From(context_->v8_context())->context_holder(); |
| 533 } | 535 } |
| 534 | 536 |
| 535 } // namespace extensions | 537 } // namespace extensions |
| OLD | NEW |