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

Unified Diff: bin/process_script.h

Issue 8549009: Refactor the library tag handler to share code between standalone dart and the snapshot generator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bin/main.cc ('k') | bin/process_script.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/process_script.h
===================================================================
--- bin/process_script.h (revision 1664)
+++ bin/process_script.h (working copy)
@@ -1,63 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#ifndef BIN_PROCESS_SCRIPT_H_
-#define BIN_PROCESS_SCRIPT_H_
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-class CommandLineOptions {
- public:
- explicit CommandLineOptions(int max_count)
- : count_(0), max_count_(max_count), arguments_(NULL) {
- static const int kWordSize = sizeof(intptr_t);
- arguments_ = reinterpret_cast<const char **>(malloc(max_count * kWordSize));
- if (arguments_ == NULL) {
- max_count_ = 0;
- }
- }
- ~CommandLineOptions() {
- free(arguments_);
- count_ = 0;
- max_count_ = 0;
- arguments_ = NULL;
- }
-
- int count() const { return count_; }
- const char** arguments() const { return arguments_; }
-
- const char* GetArgument(int index) const {
- return (index >= 0 && index < count_) ? arguments_[index] : NULL;
- }
- void AddArgument(const char* argument) {
- if (count_ < max_count_) {
- arguments_[count_] = argument;
- count_ += 1;
- } else {
- abort(); // We should never get into this situation.
- }
- }
-
- void operator delete(void* pointer) { abort(); }
-
- private:
- void* operator new(size_t size);
- CommandLineOptions(const CommandLineOptions&);
- void operator=(const CommandLineOptions&);
-
- int count_;
- int max_count_;
- const char** arguments_;
-};
-
-
-extern Dart_Handle ReadStringFromFile(const char* filename);
-extern Dart_Handle LoadScript(const char* script_name);
-extern const char* GetCanonicalPath(const char* reference_dir,
- const char* filename);
-
-
-#endif // BIN_PROCESS_SCRIPT_H_
« no previous file with comments | « bin/main.cc ('k') | bin/process_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698