Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: sky/engine/bindings/core/v8/ScriptController.cpp

Issue 682913002: Don't crash when importing a 404 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sky/engine/core/html/imports/HTMLImportLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 346
347 V8ScriptModule module; 347 V8ScriptModule module;
348 module.receiver = toV8(&document, context->Global(), m_isolate); 348 module.receiver = toV8(&document, context->Global(), m_isolate);
349 349
350 if (HTMLImport* parent = document.import()) { 350 if (HTMLImport* parent = document.import()) {
351 for (HTMLImport* child = parent->firstChild(); child; child = child->nex t()) { 351 for (HTMLImport* child = parent->firstChild(); child; child = child->nex t()) {
352 if (HTMLLinkElement* link = static_cast<HTMLImportChild*>(child)->li nk()) { 352 if (HTMLLinkElement* link = static_cast<HTMLImportChild*>(child)->li nk()) {
353 String name = link->as(); 353 String name = link->as();
354 if (!name.isEmpty()) { 354 if (!name.isEmpty()) {
355 module.formalDependenciesAndSource.append(v8String(m_isolate , name)); 355 module.formalDependenciesAndSource.append(v8String(m_isolate , name));
356 module.resolvedDependencies.append(child->document() ? child ->document()->exports().v8Value() : v8Undefined()); 356 v8::Handle<v8::Value> actual = v8::Undefined(m_isolate);
357 if (child->document())
358 actual = child->document()->exports().v8Value();
359 module.resolvedDependencies.append(actual);
357 } 360 }
358 } 361 }
359 } 362 }
360 } 363 }
361 364
362 module.formalDependenciesAndSource.append(v8String(m_isolate, source)); 365 module.formalDependenciesAndSource.append(v8String(m_isolate, source));
363 V8ScriptRunner::runModule(m_isolate, m_frame->document(), module); 366 V8ScriptRunner::runModule(m_isolate, m_frame->document(), module);
364 } 367 }
365 368
366 } // namespace blink 369 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/html/imports/HTMLImportLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698