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

Side by Side Diff: Source/core/css/CSSVariablesMap.cpp

Issue 85263006: Make IDL Callbacks non-refcounted by default (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years 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/css/CSSVariablesMap.h ('k') | Source/core/css/CSSVariablesMapForEachCallback.h » ('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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 { 83 {
84 if (!m_styleDeclaration) 84 if (!m_styleDeclaration)
85 return; 85 return;
86 if (m_styleDeclaration->clearVariables(exceptionState)) { 86 if (m_styleDeclaration->clearVariables(exceptionState)) {
87 Iterators::iterator end = m_activeIterators.end(); 87 Iterators::iterator end = m_activeIterators.end();
88 for (Iterators::iterator it = m_activeIterators.begin(); it != end; ++it ) 88 for (Iterators::iterator it = m_activeIterators.begin(); it != end; ++it )
89 (*it)->clearedVariables(); 89 (*it)->clearedVariables();
90 } 90 }
91 } 91 }
92 92
93 void CSSVariablesMap::forEach(PassRefPtr<CSSVariablesMapForEachCallback> callbac k, ScriptValue& thisArg) const 93 void CSSVariablesMap::forEach(PassOwnPtr<CSSVariablesMapForEachCallback> callbac k, ScriptValue& thisArg) const
94 { 94 {
95 forEach(callback, &thisArg); 95 forEach(callback, &thisArg);
96 } 96 }
97 97
98 void CSSVariablesMap::forEach(PassRefPtr<CSSVariablesMapForEachCallback> callbac k) const 98 void CSSVariablesMap::forEach(PassOwnPtr<CSSVariablesMapForEachCallback> callbac k) const
99 { 99 {
100 forEach(callback, 0); 100 forEach(callback, 0);
101 } 101 }
102 102
103 void CSSVariablesMap::forEach(PassRefPtr<CSSVariablesMapForEachCallback> callbac k, ScriptValue* thisArg) const 103 void CSSVariablesMap::forEach(PassOwnPtr<CSSVariablesMapForEachCallback> callbac k, ScriptValue* thisArg) const
104 { 104 {
105 if (!m_styleDeclaration) 105 if (!m_styleDeclaration)
106 return; 106 return;
107 RefPtr<CSSVariablesIterator> iterator = m_styleDeclaration->variablesIterato r(); 107 RefPtr<CSSVariablesIterator> iterator = m_styleDeclaration->variablesIterato r();
108 m_activeIterators.append(iterator.get()); 108 m_activeIterators.append(iterator.get());
109 while (!iterator->atEnd()) { 109 while (!iterator->atEnd()) {
110 String name = iterator->name(); 110 String name = iterator->name();
111 String value = iterator->value(); 111 String value = iterator->value();
112 if (thisArg) 112 if (thisArg)
113 callback->handleItem(*thisArg, value, name, const_cast<CSSVariablesM ap*>(this)); 113 callback->handleItem(*thisArg, value, name, const_cast<CSSVariablesM ap*>(this));
114 else 114 else
115 callback->handleItem(value, name, const_cast<CSSVariablesMap*>(this) ); 115 callback->handleItem(value, name, const_cast<CSSVariablesMap*>(this) );
116 iterator->advance(); 116 iterator->advance();
117 } 117 }
118 ASSERT(m_activeIterators.last() == iterator.get()); 118 ASSERT(m_activeIterators.last() == iterator.get());
119 m_activeIterators.removeLast(); 119 m_activeIterators.removeLast();
120 } 120 }
121 121
122 } // namespace WebCore 122 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSVariablesMap.h ('k') | Source/core/css/CSSVariablesMapForEachCallback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698