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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "Document.h" | 9 #include "Document.h" |
10 #include "DOMWindow.h" | 10 #include "DOMWindow.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 v8::TryCatch exception_catcher; | 255 v8::TryCatch exception_catcher; |
256 | 256 |
257 String mime_type = WebCore::toWebCoreStringWithNullCheck(args[0]); | 257 String mime_type = WebCore::toWebCoreStringWithNullCheck(args[0]); |
258 if (mime_type.isEmpty() || exception_catcher.HasCaught()) { | 258 if (mime_type.isEmpty() || exception_catcher.HasCaught()) { |
259 return v8::Undefined(); | 259 return v8::Undefined(); |
260 } | 260 } |
261 String source_string = WebCore::toWebCoreStringWithNullCheck(args[1]); | 261 String source_string = WebCore::toWebCoreStringWithNullCheck(args[1]); |
262 if (source_string.isEmpty() || exception_catcher.HasCaught()) { | 262 if (source_string.isEmpty() || exception_catcher.HasCaught()) { |
263 return v8::Undefined(); | 263 return v8::Undefined(); |
264 } | 264 } |
265 Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(args[2]); | 265 Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object
>::Cast(args[2])); |
266 if (!node || !node->attached()) { | 266 if (!node || !node->attached()) { |
267 return v8::Undefined(); | 267 return v8::Undefined(); |
268 } | 268 } |
269 | 269 |
270 Page* page = V8Proxy::retrieveFrameForEnteredContext()->page(); | 270 Page* page = V8Proxy::retrieveFrameForEnteredContext()->page(); |
271 InspectorController* inspectorController = page->inspectorController(); | 271 InspectorController* inspectorController = page->inspectorController(); |
272 return WebCore::v8Boolean(inspectorController-> | 272 return WebCore::v8Boolean(inspectorController-> |
273 addSourceToFrame(mime_type, source_string, node)); | 273 addSourceToFrame(mime_type, source_string, node)); |
274 } | 274 } |
275 | 275 |
276 // static | 276 // static |
277 v8::Handle<v8::Value> WebDevToolsClientImpl::JsAddResourceSourceToFrame( | 277 v8::Handle<v8::Value> WebDevToolsClientImpl::JsAddResourceSourceToFrame( |
278 const v8::Arguments& args) { | 278 const v8::Arguments& args) { |
279 int resource_id = static_cast<int>(args[0]->NumberValue()); | 279 int resource_id = static_cast<int>(args[0]->NumberValue()); |
280 String mime_type = WebCore::toWebCoreStringWithNullCheck(args[1]); | 280 String mime_type = WebCore::toWebCoreStringWithNullCheck(args[1]); |
281 if (mime_type.isEmpty()) { | 281 if (mime_type.isEmpty()) { |
282 return v8::Undefined(); | 282 return v8::Undefined(); |
283 } | 283 } |
284 Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(args[2]); | 284 Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object
>::Cast(args[2])); |
285 WebDevToolsClientImpl* client = static_cast<WebDevToolsClientImpl*>( | 285 WebDevToolsClientImpl* client = static_cast<WebDevToolsClientImpl*>( |
286 v8::External::Cast(*args.Data())->Value()); | 286 v8::External::Cast(*args.Data())->Value()); |
287 client->AddResourceSourceToFrame(resource_id, mime_type, node); | 287 client->AddResourceSourceToFrame(resource_id, mime_type, node); |
288 return v8::Undefined(); | 288 return v8::Undefined(); |
289 } | 289 } |
290 | 290 |
291 // static | 291 // static |
292 v8::Handle<v8::Value> WebDevToolsClientImpl::JsLoaded( | 292 v8::Handle<v8::Value> WebDevToolsClientImpl::JsLoaded( |
293 const v8::Arguments& args) { | 293 const v8::Arguments& args) { |
294 WebDevToolsClientImpl* client = static_cast<WebDevToolsClientImpl*>( | 294 WebDevToolsClientImpl* client = static_cast<WebDevToolsClientImpl*>( |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 } | 350 } |
351 | 351 |
352 // static | 352 // static |
353 v8::Handle<v8::Value> WebDevToolsClientImpl::JsUndockWindow( | 353 v8::Handle<v8::Value> WebDevToolsClientImpl::JsUndockWindow( |
354 const v8::Arguments& args) { | 354 const v8::Arguments& args) { |
355 WebDevToolsClientImpl* client = static_cast<WebDevToolsClientImpl*>( | 355 WebDevToolsClientImpl* client = static_cast<WebDevToolsClientImpl*>( |
356 v8::External::Cast(*args.Data())->Value()); | 356 v8::External::Cast(*args.Data())->Value()); |
357 client->delegate_->UndockWindow(); | 357 client->delegate_->UndockWindow(); |
358 return v8::Undefined(); | 358 return v8::Undefined(); |
359 } | 359 } |
OLD | NEW |