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

Side by Side Diff: Source/core/html/PluginDocument.cpp

Issue 22417002: Rename ASSERT_NO_EXCEPTION_STATE and IGNORE_EXCEPTION_STATE (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/MediaDocument.cpp ('k') | Source/core/html/RangeInputType.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) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void createDocumentStructure(); 64 void createDocumentStructure();
65 65
66 PluginView* pluginView() const; 66 PluginView* pluginView() const;
67 67
68 HTMLEmbedElement* m_embedElement; 68 HTMLEmbedElement* m_embedElement;
69 }; 69 };
70 70
71 void PluginDocumentParser::createDocumentStructure() 71 void PluginDocumentParser::createDocumentStructure()
72 { 72 {
73 RefPtr<Element> rootElement = document()->createElement(htmlTag, false); 73 RefPtr<Element> rootElement = document()->createElement(htmlTag, false);
74 document()->appendChild(rootElement, IGNORE_EXCEPTION_STATE); 74 document()->appendChild(rootElement, IGNORE_EXCEPTION);
75 toHTMLHtmlElement(rootElement.get())->insertedByParser(); 75 toHTMLHtmlElement(rootElement.get())->insertedByParser();
76 76
77 if (document()->frame() && document()->frame()->loader()) 77 if (document()->frame() && document()->frame()->loader())
78 document()->frame()->loader()->dispatchDocumentElementAvailable(); 78 document()->frame()->loader()->dispatchDocumentElementAvailable();
79 79
80 RefPtr<Element> body = document()->createElement(bodyTag, false); 80 RefPtr<Element> body = document()->createElement(bodyTag, false);
81 body->setAttribute(marginwidthAttr, "0"); 81 body->setAttribute(marginwidthAttr, "0");
82 body->setAttribute(marginheightAttr, "0"); 82 body->setAttribute(marginheightAttr, "0");
83 body->setAttribute(styleAttr, "background-color: rgb(38,38,38)"); 83 body->setAttribute(styleAttr, "background-color: rgb(38,38,38)");
84 84
85 rootElement->appendChild(body, IGNORE_EXCEPTION_STATE); 85 rootElement->appendChild(body, IGNORE_EXCEPTION);
86 86
87 RefPtr<Element> embedElement = document()->createElement(embedTag, false); 87 RefPtr<Element> embedElement = document()->createElement(embedTag, false);
88 88
89 m_embedElement = static_cast<HTMLEmbedElement*>(embedElement.get()); 89 m_embedElement = static_cast<HTMLEmbedElement*>(embedElement.get());
90 m_embedElement->setAttribute(widthAttr, "100%"); 90 m_embedElement->setAttribute(widthAttr, "100%");
91 m_embedElement->setAttribute(heightAttr, "100%"); 91 m_embedElement->setAttribute(heightAttr, "100%");
92 92
93 m_embedElement->setAttribute(nameAttr, "plugin"); 93 m_embedElement->setAttribute(nameAttr, "plugin");
94 m_embedElement->setAttribute(srcAttr, document()->url().string()); 94 m_embedElement->setAttribute(srcAttr, document()->url().string());
95 95
96 DocumentLoader* loader = document()->loader(); 96 DocumentLoader* loader = document()->loader();
97 ASSERT(loader); 97 ASSERT(loader);
98 if (loader) 98 if (loader)
99 m_embedElement->setAttribute(typeAttr, loader->mimeType()); 99 m_embedElement->setAttribute(typeAttr, loader->mimeType());
100 100
101 toPluginDocument(document())->setPluginNode(m_embedElement); 101 toPluginDocument(document())->setPluginNode(m_embedElement);
102 102
103 body->appendChild(embedElement, IGNORE_EXCEPTION_STATE); 103 body->appendChild(embedElement, IGNORE_EXCEPTION);
104 104
105 Frame* frame = document()->frame(); 105 Frame* frame = document()->frame();
106 if (!frame) 106 if (!frame)
107 return; 107 return;
108 Settings* settings = frame->settings(); 108 Settings* settings = frame->settings();
109 if (!settings || !frame->loader()->allowPlugins(NotAboutToInstantiatePlugin) ) 109 if (!settings || !frame->loader()->allowPlugins(NotAboutToInstantiatePlugin) )
110 return; 110 return;
111 111
112 document()->updateLayout(); 112 document()->updateLayout();
113 113
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // with how many times we call beforeload on object elements. <rdar://proble m/8441094>. 196 // with how many times we call beforeload on object elements. <rdar://proble m/8441094>.
197 if (!shouldLoadPluginManually()) 197 if (!shouldLoadPluginManually())
198 return; 198 return;
199 199
200 DocumentLoader* documentLoader = frame()->loader()->activeDocumentLoader(); 200 DocumentLoader* documentLoader = frame()->loader()->activeDocumentLoader();
201 documentLoader->cancelMainResourceLoad(ResourceError::cancelledError(documen tLoader->request().url())); 201 documentLoader->cancelMainResourceLoad(ResourceError::cancelledError(documen tLoader->request().url()));
202 setShouldLoadPluginManually(false); 202 setShouldLoadPluginManually(false);
203 } 203 }
204 204
205 } 205 }
OLDNEW
« no previous file with comments | « Source/core/html/MediaDocument.cpp ('k') | Source/core/html/RangeInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698