OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/bindings_utils.h" | 5 #include "chrome/renderer/extensions/bindings_utils.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "chrome/renderer/render_view.h" | 8 #include "chrome/renderer/render_view.h" |
9 #include "webkit/api/public/WebFrame.h" | 9 #include "webkit/api/public/WebFrame.h" |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 return contexts; | 63 return contexts; |
64 } | 64 } |
65 | 65 |
66 ContextList::iterator FindContext(v8::Handle<v8::Context> context) { | 66 ContextList::iterator FindContext(v8::Handle<v8::Context> context) { |
67 ContextList& all_contexts = GetContexts(); | 67 ContextList& all_contexts = GetContexts(); |
68 | 68 |
69 ContextList::iterator it = all_contexts.begin(); | 69 ContextList::iterator it = all_contexts.begin(); |
70 for (; it != all_contexts.end(); ++it) { | 70 for (; it != all_contexts.end(); ++it) { |
71 if ((*it)->context == context) | 71 if ((*it)->context == context) |
72 break; | 72 break; |
73 } | 73 } |
74 | 74 |
75 return it; | 75 return it; |
76 } | 76 } |
77 | 77 |
78 PendingRequestMap& GetPendingRequestMap() { | 78 PendingRequestMap& GetPendingRequestMap() { |
79 return Singleton<SingletonData>::get()->pending_requests; | 79 return Singleton<SingletonData>::get()->pending_requests; |
80 } | 80 } |
81 | 81 |
82 RenderView* GetRenderViewForCurrentContext() { | 82 RenderView* GetRenderViewForCurrentContext() { |
(...skipping 30 matching lines...) Expand all Loading... |
113 NOTREACHED(); | 113 NOTREACHED(); |
114 return; | 114 return; |
115 } | 115 } |
116 | 116 |
117 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value); | 117 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value); |
118 if (!function.IsEmpty()) | 118 if (!function.IsEmpty()) |
119 function->Call(v8::Object::New(), argc, argv); | 119 function->Call(v8::Object::New(), argc, argv); |
120 } | 120 } |
121 | 121 |
122 } // namespace bindings_utils | 122 } // namespace bindings_utils |
OLD | NEW |