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

Side by Side Diff: Source/bindings/v8/custom/V8DocumentLocationCustom.cpp

Issue 27207002: Add support for [PutForwards] IDL extended attribute (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 7 years, 2 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/bindings/tests/results/V8TestObject.cpp ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2000 Harri Porten (porten@kde.org)
3 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
4 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
5 * Copyright (C) 2006 James G. Speth (speth@end.com)
6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org)
7 * Copyright (C) 2007, 2008, 2009 Google Inc. All Rights Reserved.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24 #include "config.h"
25 #include "V8Document.h"
26
27 #include "V8Location.h"
28 #include "bindings/v8/V8Binding.h"
29 #include "core/frame/DOMWindow.h"
30 #include "core/frame/Location.h"
31
32 namespace WebCore {
33
34 void V8Document::locationAttributeGetterCustom(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
35 {
36 Document* document = V8Document::toNative(info.Holder());
37 if (!document->frame()) {
38 v8SetReturnValueNull(info);
39 return;
40 }
41
42 DOMWindow* window = document->domWindow();
43 v8SetReturnValueFast(info, window->location(), document);
44 }
45
46 void V8Document::locationAttributeSetterCustom(v8::Local<v8::String> name, v8::L ocal<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
47 {
48 Document* document = V8Document::toNative(info.Holder());
49 if (!document->frame())
50 return;
51
52 DOMWindow* window = document->domWindow();
53 if (Location* location = window->location()) {
54 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringValue, va lue);
55 location->setHref(activeDOMWindow(), firstDOMWindow(), stringValue);
56 }
57 }
58
59 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698