OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/renderer/extensions/chrome_v8_context_set.h" | 5 #include "chrome/renderer/extensions/chrome_v8_context_set.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/tracked_objects.h" | 9 #include "base/tracked_objects.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // the render view from the current context. | 41 // the render view from the current context. |
42 if (!event_url.is_valid()) | 42 if (!event_url.is_valid()) |
43 return true; | 43 return true; |
44 | 44 |
45 WebKit::WebDocument document = | 45 WebKit::WebDocument document = |
46 render_view->GetWebView()->mainFrame()->document(); | 46 render_view->GetWebView()->mainFrame()->document(); |
47 return GURL(document.url()).SchemeIs(extensions::kExtensionScheme) && | 47 return GURL(document.url()).SchemeIs(extensions::kExtensionScheme) && |
48 document.securityOrigin().canRequest(event_url); | 48 document.securityOrigin().canRequest(event_url); |
49 } | 49 } |
50 | 50 |
51 } | 51 } // namespace |
52 | 52 |
53 ChromeV8ContextSet::ChromeV8ContextSet() { | 53 ChromeV8ContextSet::ChromeV8ContextSet() { |
54 } | 54 } |
55 ChromeV8ContextSet::~ChromeV8ContextSet() { | 55 ChromeV8ContextSet::~ChromeV8ContextSet() { |
56 } | 56 } |
57 | 57 |
58 int ChromeV8ContextSet::size() const { | 58 int ChromeV8ContextSet::size() const { |
59 return static_cast<int>(contexts_.size()); | 59 return static_cast<int>(contexts_.size()); |
60 } | 60 } |
61 | 61 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 v8_arguments.push_back(converter->ToV8Value(item, context)); | 145 v8_arguments.push_back(converter->ToV8Value(item, context)); |
146 } | 146 } |
147 | 147 |
148 v8::Handle<v8::Value> retval; | 148 v8::Handle<v8::Value> retval; |
149 (*it)->CallChromeHiddenMethod( | 149 (*it)->CallChromeHiddenMethod( |
150 method_name, v8_arguments.size(), &v8_arguments[0], &retval); | 150 method_name, v8_arguments.size(), &v8_arguments[0], &retval); |
151 } | 151 } |
152 } | 152 } |
153 | 153 |
154 } // namespace extensions | 154 } // namespace extensions |
OLD | NEW |